package sudroid.android;

import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
import sudroid.DataStructureUtil;

public class IntentUtil
{
  public static String flagsToString(int paramInt)
  {
    StringBuilder localStringBuilder1 = new StringBuilder("intent flags:\n");
    if ((0x400000 & paramInt) == 4194304)
      StringBuilder localStringBuilder2 = localStringBuilder1.append("FLAG_ACTIVITY_BROUGHT_TO_FRONT").append("\n");
    while (true)
    {
      return localStringBuilder1.toString();
      if ((0x4000000 & paramInt) == 67108864)
      {
        StringBuilder localStringBuilder3 = localStringBuilder1.append("FLAG_ACTIVITY_CLEAR_TOP").append("\n");
        continue;
      }
      if ((paramInt & 0x80000) == 524288)
      {
        StringBuilder localStringBuilder4 = localStringBuilder1.append("FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET").append("\n");
        continue;
      }
      if ((0x800000 & paramInt) == 8388608)
      {
        StringBuilder localStringBuilder5 = localStringBuilder1.append("FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS").append("\n");
        continue;
      }
      if ((0x2000000 & paramInt) == 33554432)
      {
        StringBuilder localStringBuilder6 = localStringBuilder1.append("FLAG_ACTIVITY_FORWARD_RESULT").append("\n");
        continue;
      }
      if ((0x100000 & paramInt) == 1048576)
      {
        StringBuilder localStringBuilder7 = localStringBuilder1.append("FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY").append("\n");
        continue;
      }
      if ((0x8000000 & paramInt) == 134217728)
      {
        StringBuilder localStringBuilder8 = localStringBuilder1.append("FLAG_ACTIVITY_MULTIPLE_TASK").append("\n");
        continue;
      }
      if ((0x10000000 & paramInt) == 268435456)
      {
        StringBuilder localStringBuilder9 = localStringBuilder1.append("FLAG_ACTIVITY_NEW_TASK").append("\n");
        continue;
      }
      if ((paramInt & 0x40000000) == 1073741824)
      {
        StringBuilder localStringBuilder10 = localStringBuilder1.append("FLAG_ACTIVITY_NO_HISTORY").append("\n");
        continue;
      }
      if ((paramInt & 0x40000) == 262144)
      {
        StringBuilder localStringBuilder11 = localStringBuilder1.append("FLAG_ACTIVITY_NO_USER_ACTION").append("\n");
        continue;
      }
      if ((0x1000000 & paramInt) == 16777216)
      {
        StringBuilder localStringBuilder12 = localStringBuilder1.append("FLAG_ACTIVITY_PREVIOUS_IS_TOP").append("\n");
        continue;
      }
      if ((paramInt & 0x20000) == 131072)
      {
        StringBuilder localStringBuilder13 = localStringBuilder1.append("FLAG_ACTIVITY_REORDER_TO_FRONT").append("\n");
        continue;
      }
      if ((0x200000 & paramInt) == 2097152)
      {
        StringBuilder localStringBuilder14 = localStringBuilder1.append("FLAG_ACTIVITY_RESET_TASK_IF_NEEDED").append("\n");
        continue;
      }
      if ((0x20000000 & paramInt) == 536870912)
      {
        StringBuilder localStringBuilder15 = localStringBuilder1.append("FLAG_ACTIVITY_SINGLE_TOP").append("\n");
        continue;
      }
      if ((paramInt & 0x8) == 8)
      {
        StringBuilder localStringBuilder16 = localStringBuilder1.append("FLAG_DEBUG_LOG_RESOLUTION").append("\n");
        continue;
      }
      if ((paramInt & 0x4) == 4)
      {
        StringBuilder localStringBuilder17 = localStringBuilder1.append("FLAG_FROM_BACKGROUND").append("\n");
        continue;
      }
      if ((paramInt & 0x1) == 1)
      {
        StringBuilder localStringBuilder18 = localStringBuilder1.append("FLAG_GRANT_READ_URI_PERMISSION").append("\n");
        continue;
      }
      if ((paramInt & 0x2) == 2)
      {
        StringBuilder localStringBuilder19 = localStringBuilder1.append("FLAG_GRANT_WRITE_URI_PERMISSION").append("\n");
        continue;
      }
      if ((paramInt & 0x40000000) != 1073741824)
        continue;
      StringBuilder localStringBuilder20 = localStringBuilder1.append("FLAG_RECEIVER_REGISTERED_ONLY").append("\n");
    }
  }

  public static List<ResolveInfo> getIntentResolveInfo(Context paramContext, Intent paramIntent)
  {
    return paramContext.getPackageManager().queryIntentActivities(paramIntent, 65536);
  }

  public static boolean isIntentAvailable(Context paramContext, Intent paramIntent)
  {
    if (getIntentResolveInfo(paramContext, paramIntent).size() > 0);
    for (int i = 1; ; i = 0)
      return i;
  }

  private static String printUriData(Uri paramUri)
  {
    return UriUtil.toString(paramUri);
  }

  public static String toString(Intent paramIntent)
  {
    StringBuilder localStringBuilder1 = new StringBuilder();
    ComponentName localComponentName = paramIntent.getComponent();
    if (localComponentName != null)
    {
      StringBuilder localStringBuilder2 = localStringBuilder1.append("ClassName:");
      String str1 = localComponentName.getClassName();
      StringBuilder localStringBuilder3 = localStringBuilder2.append(str1).append("\n");
    }
    StringBuilder localStringBuilder4 = localStringBuilder1.append("Package:");
    String str2 = paramIntent.getPackage();
    StringBuilder localStringBuilder5 = localStringBuilder4.append(str2).append("\n");
    StringBuilder localStringBuilder6 = localStringBuilder1.append("Action:");
    String str3 = paramIntent.getAction();
    StringBuilder localStringBuilder7 = localStringBuilder6.append(str3).append("\n");
    StringBuilder localStringBuilder8 = localStringBuilder1.append("Categories:");
    String str4 = DataStructureUtil.collectionToString(paramIntent.getCategories());
    StringBuilder localStringBuilder9 = localStringBuilder8.append(str4);
    String str5 = printUriData(paramIntent.getData());
    StringBuilder localStringBuilder10 = localStringBuilder1.append(str5);
    StringBuilder localStringBuilder11 = localStringBuilder1.append("DataString:");
    String str6 = paramIntent.getDataString();
    StringBuilder localStringBuilder12 = localStringBuilder11.append(str6).append("\n");
    StringBuilder localStringBuilder13 = localStringBuilder1.append("Scheme:");
    String str7 = paramIntent.getScheme();
    StringBuilder localStringBuilder14 = localStringBuilder13.append(str7).append("\n");
    StringBuilder localStringBuilder15 = localStringBuilder1.append("Type:");
    String str8 = paramIntent.getType();
    StringBuilder localStringBuilder16 = localStringBuilder15.append(str8).append("\n");
    StringBuilder localStringBuilder17 = localStringBuilder1.append("Flags:");
    int i = paramIntent.getFlags();
    StringBuilder localStringBuilder18 = localStringBuilder17.append(i).append("\n");
    Bundle localBundle = paramIntent.getExtras();
    StringBuilder localStringBuilder19 = localStringBuilder1.append("Extras:");
    Iterator localIterator;
    if (localBundle != null)
    {
      Set localSet = localBundle.keySet();
      if (localSet != null)
      {
        StringBuilder localStringBuilder20 = localStringBuilder1.append("{\n");
        localIterator = localSet.iterator();
        if (!localIterator.hasNext())
          StringBuilder localStringBuilder21 = localStringBuilder1.append("}\n");
      }
    }
    while (true)
    {
      return localStringBuilder1.toString();
      String str9 = (String)localIterator.next();
      StringBuilder localStringBuilder22 = new StringBuilder("key:").append(str9).append("\tvalue:");
      Object localObject1 = localBundle.get(str9);
      String str10 = localObject1;
      int j = Log.d("TestActivity.java", str10);
      StringBuilder localStringBuilder23 = localStringBuilder1.append(str9).append(" ---- ");
      Object localObject2 = localBundle.get(str9);
      StringBuilder localStringBuilder24 = localStringBuilder23.append(localObject2).append("\n");
      break;
      StringBuilder localStringBuilder25 = localStringBuilder1.append("null").append("\n");
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     sudroid.android.IntentUtil
 * JD-Core Version:    0.6.0
 */